/** @file If.h
  *
  * @brief This file contains macro definition of interface
  * of Bluetooth driver.
  * 
  * (c) Copyright 2003-2007, Marvell International Ltd.
  * All Rights Reserved
  */

#ifndef _INC_IF_H
#define _INC_IF_H

#include <SDCardDDK.h>
#include "if_sdio.h"
#include "sdio.h"


#define If_Initialize                   sdio_Initialization
#define If_FirmwareDownload             sdio_FirmwareDownload
#define If_IsFirmwareLoaded             sdio_IsFirmwareLoaded
#define If_DownloadPkt                  SDIODownloadPkt
#define If_GetLengthOfDataBlock         sdio_ReadScratch
#define If_GetDataBlock                 sdio_GetDataBlock
#define If_ReadRegister(Adapter, Function, Address, ReadAfterWrite, pBuffer, BufferLength) \
    (SDReadWriteRegistersDirect((Adapter)->hDevice, SD_IO_READ, (Function), (Address), (ReadAfterWrite), (pBuffer), (BufferLength)))
#define If_WriteRegister(Adapter, Function, Address, ReadAfterWrite, pBuffer, BufferLength) \
    (SDReadWriteRegistersDirect((Adapter)->hDevice, SD_IO_WRITE, (Function), (Address), (ReadAfterWrite), (pBuffer), (BufferLength)))
#define If_EnableInterrupt(x)           sdio_EnableInterrupt(x)
#define If_DisableInterrupt(x)          sdio_DisableInterrupt(x) 
#define If_ReInitialize                 SDIOInitialization
#define If_ReInitCard                   sdio_ReInitCard  
#define If_PowerUpDevice                sdio_PowerUpDevice

#endif
